package net.aiotos.common.dto;

import jdk.nashorn.internal.runtime.regexp.joni.exception.ValueException;
import lombok.AllArgsConstructor;

@AllArgsConstructor
public class LoginDTO {
    /**
     * 平台帐号
     */
    public final String username;
    /**
     * 平台密码
     */
    public final String password;
    /**
     * 网关UUDI，如：b81fd41ce62111ec9705525400ffc252
     */
    public final String uuid;
    /**
     * 中台地址,如：http://sys.aiotos.net
     */
    public final String httpHost;
    /**
     * 证书目录
     */
    public final String certDir;


    public void validate() {
        if(username.isEmpty() || password.isEmpty() || uuid.isEmpty() || httpHost.isEmpty()) {
            throw new ValueException("username/password/uuid/httpHost相关参数不能为空");
        }

    }
}
